const app = getApp()
Page({
  data: {
    motto: 'Hello Tom',
    info:{v1:'abc',v2:'def'},
    show:false,
    programs:["项目1","项目2","项目3","项目4"]
  },
  setShow(){
    let flag=this.data.show;
    if(flag){
      this.setData({show:false})
    }else{
      this.setData({show:true})
    }
  },
  bindViewTap() {
    wx.navigateTo({
      url: '/pages/logs/logs',
    })
  },
  testTap() {
    if (this.data.motto == 'Hello Tom') {
      this.data.motto="点击了按钮一下"
    } else {
      this.setData({
        motto: 'Hello Tom'
      });
    }
    console.log(this.data.motto)
  },
  toImage() {
    wx.navigateTo({
      url: '/pages/images/images',
    })
  },
  toForms() {
    wx.navigateTo({
      url: '/pages/forms/forms',
    })
  },
  toTabs() {
    wx.navigateTo({
      url: '/pages/tabs/tabs',
    })
  },
  toBase: function () {
    wx.navigateTo({
      url: '/pages/base/base?name=tom&password=123456',
      success:function(){
        console.log("success...");
      },
      fail:function(){
        console.log("fail...");
      },
      complete:function(){
        console.log("api over...");
      }
    })
  },
  toPicker() {
    wx.navigateTo({
      url: '/pages/picker/picker',
      events:{
        acceptData(data){
          console.log(data)
        }
      }
    })
  },
  containerOperation(){
    wx.showToast({
      title: '执行containerOperation...',
      icon: 'success'
    })
  }
})